﻿<?php
error_reporting(0);
define('IN_QY',true);
session_start();
require("include/common.inc.php");
define('SCRIPT','ad_list');

?>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>搜索中心-众晒网</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link href="/ui/xianzhi/css/style.css" rel="stylesheet" type="text/css"/>
        <link href="/ui/xianzhi/css/css.css" rel="stylesheet" type="text/css"/>
        <script type="text/javascript" src="/ui/xianzhi/js/jquery.min.js"></script>
        <script type="text/javascript" src="/ui/xianzhi/js/slider.js"></script>
        <script type="text/javascript" src="/ui/xianzhi/js/tab.js"></script>
        <script type="text/javascript" src="/ui/xianzhi/js/jquery.bxslider.js"></script>
        <script type="text/javascript" src="/ui/xianzhi/js/jquery-ui.min.js"></script>
        <script type="text/javascript" src="/ui/xianzhi/js/jquery.simplesidebar.js"></script>
		<script type="text/javascript" src="/ui/layer/mobile/layer.js"></script>   
				<script src="dropload.min.js"></script>
				
				<style>
.content{max-width: 640px;margin: 0 auto;background-color: #fff;}
.dropload-up,.dropload-down{position: relative; height: 0;overflow: hidden;font-size: 12px;-webkit-transform:translateZ(0);transform:translateZ(0);}
.dropload-down{height: 0px;}
.dropload-refresh,.dropload-update,.dropload-load,.dropload-noData{height: 0px;line-height: 50px;text-align: center;}
.dropload-load .loading{
    display: inline-block; height: 15px;width: 15px;border-radius: 100%; margin: 6px;border: 2px solid #666;border-bottom-color: transparent;vertical-align: middle;-webkit-animation: rotate 0.75s linear infinite;animation: rotate 0.75s linear infinite;}
@-webkit-keyframes rotate {0% {-webkit-transform: rotate(0deg);}50% {-webkit-transform: rotate(180deg);}100% {-webkit-transform: rotate(360deg);}}
@keyframes rotate {0% {transform: rotate(0deg);}50% {transform: rotate(180deg); }100% {transform: rotate(360deg); }}
.opacity{-webkit-animation: opacity 0.3s linear; animation: opacity 0.3s linear;}
@-webkit-keyframes opacity {0% {opacity:0;}100% {opacity:1;}}
@keyframes opacity {0% {opacity:0;}100% {opacity:1;}}	
.aui-search-box1 {margin-left: -23%;height: 31px;}			
.screen .list .button{border-radius: 5px;}				
.screen .bd {padding: 5% 0;border-bottom: 1px solid #D7D4D4;}
.jd {border-bottom: 1px solid #D7D4D4;padding: 5% 0;border-bottom: 1px solid #D7D4D4;}
.sd {padding: 5% 0;border-bottom: 1px solid #D7D4D4;}
.ft {padding: 5% 0;border-bottom: 1px solid #D7D4D4;}				
				</style>
    </head>
    <body>
        <section class="aui-flexView">
            <header class="aui-navBar aui-navBar-fixed">
			
                <a href="javascript:history.back(-1);" class="aui-navBar-item">
                    <i class="icon icon-return"></i>
                </a>
				
                <div class="aui-center" style="width:100%">
                    <div class="aui-search-box1">
                        <i class="icon icon-search"></i>
                        <input type="text" id="sname" value="<?=$_GET['s']?>" placeholder="搜索">
                    </div>
                </div>
				
                <a href="javascript:;" class="aui-navBar-item" style="min-width: 14%; flex: 0 0 14%;">
             
                    <span onclick="add()"  class="aui-badge" style="font-size: 27px;border: 1px solid #FFC107;padding: 3px;border-radius: 7px;height: 25px;"><div style="width: 25px;"><p style="font-size: 16px; text-align: center; line-height: : 15px;">搜</p></div></span>
                </a>
				
            </header>
			
			<input id="radius" value="" type="hidden"> 
			<input id="price_arc" value="" type="hidden"> 
			<input id="new" value="" type="hidden"> 
			<input id="" value="" type="hidden"> 	
			
			<input type="hidden" id="lat" name="lat">
			<input type="hidden" id="lng" name="lng">
			<input type="hidden" id="cityy" name="cityy">				
            <section class="aui-scrollView">
              
			    <div class="cont">
  <div class="platform">
      <section class="job-module"> 
  <dl class="retrie"> 
    <dt>
      <a id="area" href="javascript:;">距离排序</a>
      <a id="area" href="javascript:;">价格排序</a>
      <a  href="javascript:;" onclick="radius2()">最新发布</a>
      <a id="shaixuan" href="javascript:;"><img src="/ui/xianzhi/images/shaixuan.png">筛选</a>
    </dt> 
    <dd class="area"> 
      <ul class="slide downlist"> 

        <li><a href="javascript:;" onclick="radius('1')">1km以内</a></li> 
        <li><a href="javascript:;" onclick="radius('3')">1km-3km</a></li> 
        <li><a href="javascript:;" onclick="">3km-5km</a></li> 
        <li><a href="javascript:;" onclick="">5km以上</a></li>
      </ul> 
    </dd> 
    
    <dd class="area"> 
      <ul class="slide downlist"> 
        <li><a href="javascript:;" onclick="radius1('0')">价格从低到高</a></li> 
        <li><a href="javascript:;" onclick="radius1('1')">价格从高到低</a></li> 
        
      </ul> 
    </dd> 
     
  </dl> 
    </section>

    <section class="screen">
    <div class="top">筛选</div>
    <div class="hd">
          <div class="title">服务分类</div>
            <div class="list">
            <input class="button" name="" type="button" value="保洁清洗">
            <input class="button" name="" type="button" value="保姆月嫂">
            <input class="button" name="" type="button" value="产后母婴">
            <input class="button" name="" type="button" value="专家咨询">
            <input class="button" name="" type="button" value="手工零玩">
            <input class="button" name="" type="button" value="美容美甲">
            <input class="button" name="" type="button" value="小儿推拿">
            <input class="button" name="" type="button" value="兴趣教学">
            
          </div>
        </div>
        
       <div class="bd">
          <div class="title">服务年龄段</div>
            <div class="list">
            <input class="button" name="" type="button" value="0~6月">
            <input class="button" name="" type="button" value="6~12月">
            <input class="button" name="" type="button" value="1~3岁">
            <input class="button" name="" type="button" value="4~8岁">
          </div>
       </div>

       <div class="jd">
          <div class="title">服务年龄段</div>
            <div class="list">
            <input class="button" name="" type="button" value="1~2年">
            <input class="button" name="" type="button" value="3~5年">
            <input class="button" name="" type="button" value="5~7年">
            <input class="button" name="" type="button" value="8~10年">
            <input class="button" name="" type="button" value="10年以上">
          </div>
       </div>

       <div class="sd">
          <div class="title">服务年龄段</div>
            <div class="list">
            <input class="button" name="" type="button" value="商家">
            <input class="button" name="" type="button" value="个人">
          </div>
       </div>

       
       <div class="ft">
        <input class="submit" type="submit" value="提交" >
        <input class="reset" type="reset" value="重置">
       
       </div>
       
  </section>
    
    

<script type="text/javascript">
$( document ).ready(function() {
  $( '.screen' ).simpleSidebar({
    settings: {
      opener: '#shaixuan',
      wrapper: '.wrapper',
      animation: {
        duration: 500,
        easing: 'easeOutQuint'
      }
    },
    sidebar: {
      align: 'right',
      closingLinks: 'a',
    }
  });
});
</script>

     <script type="text/javascript">
$(function(){ 
  $('.retrie dt a').click(function(){
    var $t=$(this);
    if($t.hasClass('up')){
      $(".retrie dt a").removeClass('up');
      $('.downlist').hide();
      $('.mask').hide();
    }else{
      $(".retrie dt a").removeClass('up');
      $('.downlist').hide();
      $t.addClass('up');
      $('.downlist').eq($(".retrie dt a").index($(this)[0])).show();
      $('.mask').show();
    }
  });
  $(".area ul li a:contains('"+$('#area').text()+"')").addClass('selected');
});
</script> 
  
    </div>
	
	<div   class="listte">
	<div   class="listter">

	</div>
	</div>	
            </section>

        </section>
		
       <script>  
        if (navigator.geolocation){  

            navigator.geolocation.getCurrentPosition(  

                function( position ) {    

                    show_msg( position );  

                 },  

                function( err ) {  

                    switch(error.code){  
                    case 0:  
                      alert("尝试获取您的位置信息时发生错误：" + error.message);  
                      break;  
                    case 1:  
                        alert("用户拒绝了获取位置信息请求。");  
                      break;  
                    case 2:  
                        alert("浏览器无法获取您的位置信息：" + error.message);  
                      break;  
                    case 3:  
                        alert("获取您位置信息超时。");  
                      break;  
                    }  
                }  
       )}else  
          alert( '您当前使用的浏览器不支持Geolocation服务' );  


        function show_msg( position ){  

            var lat = position.coords.latitude;

            var lng = position.coords.longitude; 
            $("#lat").val(lat);
			$("#lng").val(lng);
			
           // alert( "您所在的位置： 经度" +  + "，纬度" + lng );  
            if( typeof position.address != "undefined" ){  

                var country = position.address.country; 

                var province = position.address.region;

                var city = position.address.city;  

               // alert(' 您位于 ' + country + province + '省' + city +'市');  
            }  
			
			  var latlon = position.coords.latitude+','+position.coords.longitude; 
 
  //baidu
  var url = "http://api.map.baidu.com/geocoder/v2/?ak=C93b5178d7a8ebdb830b9b557abce78b&callback=renderReverse&location="+latlon+"&output=json&pois=0"; 
  $.ajax({ 
    type: "GET", 
    dataType: "jsonp", 
    url: url, 
      beforeSend: function(){ 
       
		console.log('正在定位...');
      }, 
      success: function (json) { 
        if(json.status==0){ 
         // $("#baidu_geo").html(json.result.formatted_address); 
		 // alert(json.result.addressComponent.city);
		 $("#cityy").html(json.result.addressComponent.city);
        } 
      }, 
      error: function (XMLHttpRequest, textStatus, errorThrown) { 
        $("#baidu_geo").html(latlon+"地址位置获取失败"); 
    } 
  });
				
        }  
    </script> 		
		
		<script>
	//距离	
	function radius(u){
			
     $(".retrie dt a").removeClass('up');
      $('.downlist').hide();
      $('.mask').hide();
	  $("#price_arc").val(''); 
	  $("#new").val(''); 
	   $("#radius").val(u); 
		add();	
		}
		
	//价格	
	function radius1(v){
		
     $(".retrie dt a").removeClass('up');
      $('.downlist').hide();
      $('.mask').hide();
	  $("#price_arc").val(v); 
	  $("#new").val(''); 
	   $("#radius").val(''); 
		add();	
		}
		
	function radius2(){
		
     $(".retrie dt a").removeClass('up');
      $('.downlist').hide();
      $('.mask').hide();
	  $("#price_arc").val(''); 
	  $("#new").val(''); 
	  $("#radius").val(''); 
	  add();	
		}		



		
		
		</script>
		<script>
	  function add(){
		          var radius = document.getElementById("radius").value;  
                  var pricearc = document.getElementById("price_arc").value;  
		          var lat = document.getElementById("lat").value;  
                  var lng = document.getElementById("lng").value; 				  
                  var dom4 = document.getElementById('xiao');
                  var dom5 = document.getElementById('jiage');
				  var  sidd='1';
			  
			

		  var sname = document.getElementById("sname").value;   
		  
$(".listte").empty();
	   
if(sname==""){
  layer.open({
    content: '请输入搜索词'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
	
 return false;	
}

if(lat==""||lng==""){
  layer.open({
    content: '请同意获取地址授权'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
	
 return false;	
}

$(function(){
    // 页数
    var page = 0;
    // 每页展示5个
    var psize = 5;
  	
	
  

    // dropload
	
    $('.listte').dropload({
        scrollArea : window,
        loadDownFn : function(me){
            page++;
            // 拼接HTML
            var result = '';
            $.ajax({
                type: 'GET',
                url: '/api/muyin/api.php?s=skill.get_skill_list',
                dataType: 'json',
				        data: {
               keyword: sname,
			   page:page,
			   price_arc:pricearc,
			   radius:radius,
			   lat:lat,
			   lng:lng,			   
			   psize:psize
			   
              },
                success: function(data){
					
					if(data==0){
						me.lock();
                        // 无数据
                        me.noData();
						  me.resetload();
						$(".dropload-noData").empty();	
					    $(".dropload-load").empty();
					 // layer.open({
                    // content: 'end'
                   // ,skin: 'msg'
                   // ,time: 2 //2秒后自动关闭
                    // });	
					return false;	
					}

					   var arrLen = data.data.length;
					
                    if(arrLen > 0){

                        for(var i=0; i<arrLen; i++){
						var b=data.data[i].pics
			           var c=b.split(',');	
                result += '<div class="aui-order-product" onclick="g('+data.data[i].id+')">'
     +'<div class="aui-order-product-hd="><img src="'+c['0']+'" alt="" style="width: 99px; padding: 4px 14px;margin-left: 2px;"></div>'
                +'<div class="aui-order-product-bd">'
                +'<h2>'+data.data[i].title+'<img src="/ui/image/ge.png" alt="" style="width: 10px;">'
                +'<span class="aui-order-text-bd" style="float:right;">'+data.data[i].cat_name+'</span>'
                +'</h2>'
                +'<p>'+data.data[i].details+'</p>'
                +'<div class="aui-order-text">'
                +'<span class="aui-order-text-hd" style="font-size: 19px;color: red;">'+data.data[i].price+'</span>'
                +'<span class="aui-order-text-bd" style="float:right;">'
                +'<ul style="font-size: 12px;color: #7d7c78; list-style: disc; padding: auto;">'
                +'<li>服务经验:3-5年</li>'
				+'<li>服务年龄段:1-3岁</li> '           
                +'</ul>'
                +'</span>'
                 +'</div>'
                 +'<div class="aui-order-service-hd"> '  
                 +'<img src="'+data.data[i].username+'" alt="" style="width:5%">'+data.data[i].shuyu+'</div>'
                +'</div>'
                +'</div>'
                        }
                    // 如果没有数据
                    }else{
   						//alert('无搜索结果');  
						// 锁定
                        me.lock();
                        // 无数据
                        me.noData();
						

                    }
                        // 插入数据到页面，放到最后面
                        $('.listte').append(result);
                        // 每次数据插入，必须重置
                        me.resetload();
							
                
                },
                error: function(xhr, type){
                    alert('Ajax error!');
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        }
    });
}); 
	  }
	  
		</script>	
		<script>
		function g(h){
			
			
		window.location.href='jinengxq.php?id='+h;
			
		}
			
		</script>
		
	
    </body>
</html>